package com.aspose.cells;

import java.util.Iterator;

class ztn {
   private zny a = null;
   private String b = "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing";
   private String c = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing";
   private int d = 0;
   private Shape e = null;
   private String f = null;
   private String g = null;
   private zpg h = null;
   private znx i = null;
   private static final com.aspose.cells.b.c.a.za j = new com.aspose.cells.b.c.a.za(new String[]{"nvSpPr", "cNvSpPr", "a:spLocks"});

   ztn(zny var1) {
      this.a = var1;
      this.d = this.a.j.a.getWorksheets().L();
      this.e = this.a.a;
      this.i = var1.k;
      if (this.a.d != 2 && this.a.d != 4) {
         this.f = this.c;
         this.g = "xdr";
      } else {
         this.f = this.b;
         this.g = "cdr";
      }

      if (var1.a.g != null) {
         this.h = var1.a.g.k;
      }

   }

   void a(zcfx var1) throws Exception {
      String var2 = null;
      if (this.a.a.g != null) {
         var2 = this.a.a.g.g;
      }

      if (this.a.a.getMsoDrawingType() == 31) {
         var1.d(var2);
      } else if (this.a.a.getMsoDrawingType() == 6 && var2 != null && var2.indexOf("<m:oMath") != -1) {
         var1.d(var2);
      } else {
         if (this.a.b) {
            var1.d("<mc:AlternateContent xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\">");
            var1.d("<mc:Choice xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" Requires=\"a14\">");
         }

         if (!this.a.l) {
            switch(this.a.d) {
            case 0:
            default:
               var1.b("xdr:twoCellAnchor");
               break;
            case 1:
               var1.b("xdr:absoluteAnchor");
               break;
            case 2:
               var1.b("cdr:relSizeAnchor");
               var1.a("xmlns:cdr", this.b);
               break;
            case 3:
               var1.b("xdr:oneCellAnchor");
               break;
            case 4:
               var1.b("cdr:absSizeAnchor");
               var1.a("xmlns:cdr", this.b);
            }

            if ((this.e.getMsoDrawingType() != 5 || this.a.d != 1) && this.a.d == 0 && this.e.getPlacement() != 2) {
               String var3 = zase.m(this.e.getPlacement());
               var1.a("editAs", var3);
            }

            this.F(var1);
         }

         switch(this.e.getMsoDrawingType()) {
         case 0:
            this.c(var1);
            break;
         case 5:
            this.D(var1);
            break;
         case 8:
            if (this.e.x == null) {
               this.n(var1);
            } else {
               this.e(var1);
            }
            break;
         default:
            this.e(var1);
         }

         if (!this.a.l) {
            this.d(var1);
            var1.b();
         }

         if (this.a.b) {
            var1.d("</mc:Choice>");
            var1.d("<mc:Fallback/>");
            var1.d("</mc:AlternateContent>");
         }

      }
   }

   void b(zcfx var1) throws Exception {
      if (!this.a.l) {
         switch(this.a.d) {
         case 0:
         default:
            var1.b("xdr:twoCellAnchor");
            break;
         case 1:
            var1.b("xdr:absoluteAnchor");
            break;
         case 2:
            var1.b("cdr:relSizeAnchor");
            var1.a("xmlns:cdr", this.b);
            break;
         case 3:
            var1.b("xdr:oneCellAnchor");
         }

         if ((this.e.getMsoDrawingType() != 5 || this.a.d != 1) && this.a.d == 0 && this.e.getPlacement() != 2) {
            String var2 = zase.m(this.e.getPlacement());
            var1.a("editAs", var2);
         }

         this.F(var1);
      }

      this.f(var1);
      if (!this.a.l) {
         this.d(var1);
         var1.b();
      }

   }

   private void c(zcfx var1) throws Exception {
      if (this.e.getMsoDrawingType() == 0) {
         var1.b(this.g + ":grpSp");
         this.a(var1, true, false, false);
         this.r(var1);
         GroupShape var2 = (GroupShape)this.e;
         Shape[] var3 = var2.getGroupedShapes();
         Shape[] var4 = var3;
         int var5 = var3.length;

         for(int var6 = 0; var6 < var5; ++var6) {
            Shape var7 = var4[var6];
            boolean var8 = var7.af();
            zny var9 = new zny(this.i, var7, var8);
            var9.l = true;
            ztn var10 = new ztn(var9);
            var10.a(var1);
         }

         var1.b();
      }
   }

   private void d(zcfx var1) throws Exception {
      if (this.a.d != 2 && this.a.d != 4) {
         var1.b("xdr:clientData");
         if (!this.e.isLocked()) {
            var1.a("fLocksWithSheet", "0");
         }

         if (!this.e.isPrintable()) {
            var1.a("fPrintsWithSheet", "0");
         }

         var1.b();
      }
   }

   private boolean a(Shape var1) {
      if (var1.P()) {
         return false;
      } else {
         if (this.e.g != null && this.e.g.k != null && this.e.g.k.a != null && this.e.g.k.a.a) {
            if (this.e.getMsoDrawingType() == 1) {
               return true;
            }

            switch(this.e.getAutoShapeType()) {
            case 20:
               return true;
            }
         }

         switch(this.e.getAutoShapeType()) {
         case 32:
         case 33:
         case 34:
         case 35:
         case 36:
         case 37:
         case 38:
         case 39:
         case 40:
            return true;
         default:
            return false;
         }
      }
   }

   private void e(zcfx var1) throws Exception {
      boolean var2 = this.a(this.e);
      if (var2) {
         var1.b(this.g + ":cxnSp");
      } else {
         var1.b(this.g + ":sp");
      }

      this.E(var1);
      this.a(var1, false, var2, false);
      this.r(var1);
      this.g(var1);
      if (!var2 && this.a.c == null) {
         this.j(var1);
      }

      var1.b();
   }

   private void f(zcfx var1) throws Exception {
      var1.b(this.g + ":sp");
      this.E(var1);
      this.a(var1, false, false, false);
      this.s(var1);
      this.k(var1);
      var1.b();
   }

   private void g(zcfx var1) throws Exception {
      zrt var2 = this.e.p;
      if (var2 != null) {
         var1.b(this.g + ":style");
         var1.b("a:lnRef");
         var1.a("idx", var2.a.a);
         ztj.a(var1, var2.a.b, -1, this.a.j.a);
         var1.b();
         var1.b("a:fillRef");
         var1.a("idx", var2.c.a);
         ztj.a(var1, var2.c.b, -1, this.a.j.a);
         var1.b();
         var1.b("a:effectRef");
         var1.a("idx", var2.d.a);
         ztj.a(var1, var2.d.b, -1, this.a.j.a);
         var1.b();
         var1.b("a:fontRef");
         var1.a("idx", var2.b.a);
         ztj.a(var1, var2.b.b, -1, this.a.j.a);
         var1.b();
         var1.b();
      }
   }

   private String a(String var1, boolean var2, boolean var3, boolean var4) {
      if (var4) {
         switch(j.a(var1)) {
         case 0:
            return this.g + ":nvPicPr";
         case 1:
            return this.g + ":cNvPicPr";
         case 2:
            return "a:picLocks";
         }
      } else if (var2) {
         switch(j.a(var1)) {
         case 0:
            return this.g + ":nvGrpSpPr";
         case 1:
            return this.g + ":cNvGrpSpPr";
         case 2:
            return "a:grpSpLocks";
         }
      } else if (var3) {
         switch(j.a(var1)) {
         case 0:
            return this.g + ":nvCxnSpPr";
         case 1:
            return this.g + ":cNvCxnSpPr";
         case 2:
            return "a:cxnSpLocks";
         }
      } else {
         switch(j.a(var1)) {
         case 0:
            return this.g + ":nvSpPr";
         case 1:
            return this.g + ":cNvSpPr";
         case 2:
            return "a:spLocks";
         }
      }

      return null;
   }

   private void a(zcfx var1, boolean var2, boolean var3, boolean var4) throws Exception {
      var1.b(this.a("nvSpPr", var2, var3, var4));
      this.C(var1);
      var1.b(this.a("cNvSpPr", var2, var3, var4));
      if (this.e.getMsoDrawingType() == 6) {
         var1.a("txBox", "1");
      }

      if (this.e.E()) {
         var1.b(this.a("a:spLocks", var2, var3, var4));
         if (!var2) {
            if (this.e.getLockedProperty(1)) {
               var1.a("noAdjustHandles", "1");
            }

            if (this.e.getLockedProperty(12)) {
               var1.a("noChangeArrowheads", "1");
            }
         }

         if (this.e.getLockedProperty(7)) {
            var1.a("noChangeAspect", "1");
         }

         if (!var2 && this.e.getLockedProperty(11)) {
            var1.a("noChangeShapeType", "1");
         }

         if (this.e.getLockedProperty(3)) {
            var1.a("noEditPoints", "1");
         }

         if (this.e.getLockedProperty(0)) {
            var1.a("noGrp", "1");
         }

         if (this.e.getLockedProperty(6)) {
            var1.a("noMove", "1");
         }

         if (this.e.getLockedProperty(10)) {
            var1.a("noResize", "1");
         }

         if (this.e.getLockedProperty(8)) {
            var1.a("noRot", "1");
         }

         if (this.e.getLockedProperty(5)) {
            var1.a("noSelect", "1");
         }

         if (!var2 && !var3 && !var4 && this.e.getLockedProperty(2)) {
            var1.a("noTextEdit", "1");
         }

         if (var4 && this.e.getLockedProperty(4)) {
            var1.a("noCrop", "1");
         }

         var1.b();
      }

      if (this.a.c != null && var4 && this.e.ac() != null) {
         var1.b("a:extLst");
         var1.b("a:ext");
         var1.a("uri", "{84589F7E-364E-4C9E-8A38-B11213B215E9}");
         var1.b("a14:cameraTool");
         var1.a("cellRange", this.e.ac());
         var1.a("spid", this.a.c.f);
         var1.b();
         var1.b();
         var1.b();
      }

      if (var3) {
         zmk var5 = this.e.f;
         if (var5 != null && var5.a != -1 && var5.c != -1) {
            var1.b("a:stCxn");
            var1.a("id", zase.y(this.e.J().get(var5.a).K()));
            var1.a("idx", zase.y(var5.b));
            var1.b();
            var1.b("a:endCxn");
            var1.a("id", zase.y(this.e.J().get(var5.c).K()));
            var1.a("idx", zase.y(var5.d));
            var1.b();
         }
      }

      var1.b();
      var1.b();
   }

   private void h(zcfx var1) throws Exception {
      zbtz var2 = this.e.ab();
      if (var2 != null) {
         zoc var3 = null;
         if (this.e.getMsoDrawingType() == 6) {
            var3 = zoc.a((TextBox)this.e, this.a.j.a);
            if (var2.i() == null && var2.n() > 0) {
               zsz.b(var1, var3);
            } else {
               zsz.a(var1, var3);
            }
         } else {
            var3 = zoc.a(var2, this.a.j.a);
            zsz.a(var1, var3);
         }
      } else {
         var1.b("a:p", (String)null);
      }

   }

   private void i(zcfx var1) throws Exception {
      TextEffectFormat var2 = this.e.getTextEffect();
      var1.b("a:p");
      String var3 = TextEffectFormat.a(var2.d());
      if (var3 != null) {
         var1.b("a:pPr");
         var1.a("algn", var3);
         var1.b();
      }

      var1.b("a:r");
      var1.b("a:rPr");
      var1.a("sz", zase.y(var2.getFontSize() * 100));
      if (var2.getFontItalic()) {
         var1.a("i", "1");
      }

      if (var2.getFontBold()) {
         var1.a("b", "1");
      }

      if (var2.b()) {
         var1.a("kern", "10");
      }

      double var4 = var2.c();
      if (var4 < 1.0D) {
         var1.a("spc", zase.y((int)((double)(var2.getFontSize() * 100) * (var4 - 1.0D) / 2.0D)));
      } else if (var4 == 1.0D) {
         var1.a("spc", "0");
      } else {
         var1.a("spc", zase.y((int)((double)(var2.getFontSize() * 100) * (var4 - 1.0D))));
      }

      this.y(var1);
      this.q(var1);
      zanx var6 = this.e.V();
      if (var6.s()) {
         var1.b("a:effectLst");
         var1.b("a:outerShdw");
         double var7 = var6.f();
         double var9 = var6.g();
         double var11 = Math.sqrt(var7 * var7 + var9 * var9);
         var1.a("dist", zase.y((int)(var11 * zml.i)));
         String var13 = "ctr";
         double var14 = 0.0D;
         if (var7 != 0.0D) {
            var14 = Math.atan(var9 / var7) / 3.141592653589793D * 180.0D;
            if (var7 > 0.0D) {
               if (var9 < 0.0D) {
                  var14 += 360.0D;
               }
            } else if (var9 >= 0.0D) {
               var14 += 180.0D;
            } else {
               var13 = "tl";
               var14 += 180.0D;
            }
         } else if (var9 > 0.0D) {
            var14 = 90.0D;
         } else {
            var14 = -90.0D;
         }

         var1.a("dir", zase.y((int)(var14 * (double)zml.j)));
         double var16 = var6.j();
         if (var16 != 1.0D) {
            var1.a("sx", zase.y((int)(var16 * (double)zml.k)));
         }

         double var18 = var6.m();
         if (var18 != 1.0D) {
            var1.a("sy", zase.y((int)(var18 * (double)zml.k)));
         }

         double var20 = var6.k();
         if (var20 != 0.0D) {
            var1.a("kx", zase.y((int)(Math.atan(var20) / 3.141592653589793D * 180.0D * (double)zml.j)));
            var13 = "bl";
         }

         double var22 = var6.q();
         double var24 = var6.r();
         if (var22 > 0.0D) {
            if (var24 > 0.0D) {
               var13 = "br";
            } else if (var24 == 0.0D) {
               var13 = "r";
            } else {
               var13 = "tr";
            }
         } else if (var22 == 0.0D) {
            if (var24 > 0.0D) {
               var13 = "b";
            } else if (var24 == 0.0D) {
               var13 = "ctr";
            } else {
               var13 = "t";
            }
         } else if (var24 > 0.0D) {
            var13 = "bl";
         } else if (var24 == 0.0D) {
            var13 = "l";
         } else {
            var13 = "tl";
         }

         if (!"".equals(var13)) {
            var1.a("algn", var13);
         }

         var1.b("a:srgbClr");
         var1.a("val", zase.a(var6.c()));
         var1.b("a:alpha");
         var1.a("val", zase.y((int)(var6.e() * (double)zml.k)));
         var1.b();
         var1.b();
         var1.b();
         var1.b();
      }

      if (var2.getFontName() != null) {
         var1.b("a:latin");
         var1.a("typeface", var2.getFontName());
         var1.b();
         var1.b("a:cs");
         var1.a("typeface", var2.getFontName());
         var1.b();
      }

      var1.b();
      var1.b("a:t", com.aspose.cells.b.a.zv.a(var2.getText(), "\r", ""));
      var1.b();
      var1.b();
   }

   private void j(zcfx var1) throws Exception {
      if (!this.b(128L)) {
         this.a(128L, var1);
      } else {
         var1.b(this.g + ":txBody");
         this.l(var1);
         this.h(var1);
         var1.b();
      }

   }

   private void k(zcfx var1) throws Exception {
      var1.b(this.g + ":txBody");
      this.m(var1);
      this.i(var1);
      var1.b();
   }

   private void l(zcfx var1) throws Exception {
      var1.b("a:bodyPr");
      if (this.e.getTextVerticalOverflow() != 2) {
         var1.a("vertOverflow", zase.aK(this.e.getTextVerticalOverflow()));
      }

      if (this.e.getTextHorizontalOverflow() != 2) {
         var1.a("horzOverflow", zase.aK(this.e.getTextHorizontalOverflow()));
      }

      String var2 = "square";
      zbtz var3 = this.e.ab();
      if (var3 != null && !var3.d) {
         var2 = "none";
      }

      var1.a("wrap", var2);
      MsoTextFrame var4 = this.e.getTextFrame();
      if (!var4.isAutoMargin()) {
         var1.a("lIns", zase.y(var4.b()));
         var1.a("tIns", zase.y(var4.d()));
         var1.a("rIns", zase.y(var4.c()));
         var1.a("bIns", zase.y(var4.e()));
      }

      if (var3 != null) {
         String var5;
         if (var3.h() != 9) {
            var5 = zase.A(var3.h());
            var1.a("anchor", var5);
         }

         if (var3.g() == 1) {
            var1.a("anchorCtr", "1");
         } else {
            var1.a("anchorCtr", "0");
         }

         var5 = "horz";
         switch(var3.f()) {
         case 0:
            var5 = "vert";
            break;
         case 1:
            var5 = "vert270";
            break;
         case 2:
            var5 = "horz";
            break;
         case 3:
            if (var3.e == 1) {
               var5 = "wordArtVert";
            } else {
               var5 = "wordArtVertRtl";
            }
            break;
         default:
            var5 = "horz";
         }

         if (var5 != null) {
            var1.a("vert", var5);
         }
      }

      if (var4.getAutoSize()) {
         var1.b("a:spAutoFit", (String)null);
      }

      var1.b();
   }

   private void m(zcfx var1) throws Exception {
      var1.b("a:bodyPr");
      var1.a("fromWordArt", "1");
      var1.a("wrap", "none");
      MsoTextFrame var2 = this.e.getTextFrame();
      if (!var2.isAutoMargin()) {
         var1.a("lIns", zase.y(var2.b()));
         var1.a("tIns", zase.y(var2.d()));
         var1.a("rIns", zase.y(var2.c()));
         var1.a("bIns", zase.y(var2.e()));
      }

      if (var2.getAutoSize()) {
         var1.b("a:spAutoFit", (String)null);
      }

      var1.b("a:prstTxWarp");
      var1.a("prst", zase.aG(this.e.getAutoShapeType()));
      zacg var3 = this.e.ai();
      int var4 = var3 == null ? 0 : var3.b();
      if (var4 > 0) {
         int var5 = 1;
         var1.b("a:avLst");

         for(int var6 = 327; var6 <= 336; ++var6) {
            if (var3.d(var6)) {
               int var7 = var3.a(var6);
               var1.b("a:gd");
               if (var4 > 1) {
                  var1.a("name", "adj" + var5);
               } else {
                  var1.a("name", "adj");
               }

               var1.a("fmla", "val " + zase.y((int)((double)var7 / 21600.0D * 100000.0D)));
               var1.b();
               ++var5;
            }
         }

         var1.b();
      }

      var1.b();
      zanq var18 = new zanq(this.e);
      if (var18.d()) {
         var1.b("a:scene3d");
         var1.b("a:camera");
         String var19 = "legacyObliqueRight";
         double var20 = var18.h();
         double var9 = var18.i();
         double var11 = var18.j();
         if (var20 > 0.0D) {
            if (var9 > 0.0D) {
               if (var11 > 0.0D) {
                  var19 = "legacyPerspectiveBottomRight";
               }
            } else if (var9 == 0.0D) {
               var19 = "legacyObliqueRight";
            }
         } else if (var20 == 0.0D) {
            if (var9 <= 0.0D && var9 == 0.0D) {
               var19 = "legacyPerspectiveFront";
            }
         } else if (var9 <= 0.0D && var9 != 0.0D) {
            if (var11 > 0.0D) {
               var19 = "legacyPerspectiveTopLeft";
            } else {
               var19 = "legacyObliqueTopLeft";
            }
         }

         var1.a("prst", var19);
         if (var18.g() != 0.0D || var18.f() != 0.0D) {
            var1.b("a:rot");
            double var13 = var18.g();
            if (var13 > 0.0D) {
               var13 = 360.0D - var13;
            }

            var1.a("lat", zase.y((int)(var13 * (double)zml.j)));
            double var15 = var18.f();
            if (var15 < 0.0D) {
               var15 += 360.0D;
            }

            var1.a("lon", zase.y((int)(var15 * (double)zml.j)));
            var1.a("rev", "0");
            var1.b();
         }

         var1.b();
         var1.b("a:lightRig");
         String var21 = "legacyHarsh3";
         if (!var18.m()) {
            var21 = "legacyNormal3";
         }

         var1.a("rig", var21);
         String var14 = "t";
         int var22 = var18.k();
         int var16 = var18.l();
         if (var22 > 0) {
            if (var16 > 0) {
               var14 = "b";
            } else if (var16 == 0) {
               ;
            }
         } else if (var22 == 0) {
            if (var16 > 0) {
               var14 = "l";
            } else if (var16 != 0) {
               var14 = "r";
            }
         } else if (var16 <= 0 && var16 == 0) {
            ;
         }

         var1.a("dir", var14);
         var1.b();
         var1.b();
         var1.b("a:sp3d");
         var1.a("extrusionH", zase.y((int)(var18.b() * zml.i) - 27000));
         var1.a("prstMaterial", var18.e() ? "legacyMetal" : "legacyMatte");
         Color var17 = var18.c();
         if (!var17.isEmpty()) {
            var1.b("a:extrusionClr");
            var1.b("a:srgbClr");
            var1.a("val", zase.a(var17));
            var1.b();
            var1.b();
         }

         var1.b();
      }

      var1.b();
   }

   private void n(zcfx var1) throws Exception {
      if (this.a.a.getMsoDrawingType() == 8) {
         var1.b(this.g + ":pic");
         this.E(var1);
         this.a(var1, false, false, true);
         this.z(var1);
         this.r(var1);
         var1.b();
      }
   }

   private void o(zcfx var1) throws Exception {
      boolean var2 = this.e.N().i().d();
      boolean var3 = this.e.N().i().e();
      if (this.e.getMsoDrawingType() == 5) {
         var1.b(this.g + ":xfrm");
      } else {
         var1.b("a:xfrm");
      }

      if (this.e.getRotationAngle() != 0.0D) {
         var1.a("rot", zase.y((int)(this.e.getRotationAngle() * 60000.0D)));
      }

      if (var3) {
         var1.a("flipH", "1");
      }

      if (var2) {
         var1.a("flipV", "1");
      }

      int var4 = this.a.j.a.getWorksheets().M();
      boolean var5 = false;
      boolean var6 = false;
      boolean var7 = false;
      boolean var8 = false;
      int var29;
      int var30;
      int var31;
      int var32;
      if (this.e.S()) {
         int[] var9 = this.e.d(false);
         GroupShape var10 = (GroupShape)this.e.F();
         var29 = (int)((double)var9[0] * ((double)var10.a().b / 4000.0D) + 0.5D) + var10.a().a;
         var30 = (int)((double)var9[1] * ((double)var10.a().d / 4000.0D) + 0.5D) + var10.a().c;
         var31 = (int)((double)var9[2] * ((double)var10.a().b / 4000.0D) + 0.5D);
         var32 = (int)((double)var9[3] * ((double)var10.a().d / 4000.0D) + 0.5D);
      } else {
         if (this.a.d != 2 && this.a.d != 4) {
            var29 = zase.a((double)this.e.getLeftToCorner(), this.d);
            var30 = zase.a((double)this.e.getTopToCorner(), var4);
         } else {
            byte var33 = 0;
            byte var36 = 0;
            byte var11 = 0;
            byte var12 = 0;
            int[] var13 = new int[]{var33};
            int[] var14 = new int[]{var36};
            int[] var15 = new int[]{var11};
            int[] var16 = new int[]{var12};
            this.e.a(var13, var14, var15, var16);
            int var34 = var13[0];
            int var37 = var14[0];
            int var38 = var15[0];
            int var39 = var16[0];
            double var17 = Math.min(1.0D, (double)var34 / 4000.0D);
            double var19 = Math.min(1.0D, (double)var37 / 4000.0D);
            double var21 = Math.min(1.0D, (double)var38 / 4000.0D);
            double var23 = Math.min(1.0D, (double)var39 / 4000.0D);
            double var25 = var17 * (double)this.a.h.getChartObject().getWidth();
            var29 = zase.a((double)((int)var25), this.d);
            double var27 = var19 * (double)this.a.h.getChartObject().getHeight();
            var30 = zase.a((double)((int)var27), var4);
         }

         var31 = zase.a((double)this.e.getWidth(), this.d);
         if (var31 < 0) {
            var31 = 0;
         }

         var32 = zase.a((double)this.e.getHeight(), var4);
         if (var32 < 0) {
            var32 = 0;
         }
      }

      var1.b("a:off");
      var1.a("x", zase.y(var29));
      var1.a("y", zase.y(var30));
      var1.b();
      var1.b("a:ext");
      var1.a("cx", zase.y(var31));
      var1.a("cy", zase.y(var32));
      var1.b();
      if (this.e.isGroup()) {
         zbol var35 = ((GroupShape)this.e).a();
         var1.b("a:chOff");
         var1.a("x", zase.y(var35.a));
         var1.a("y", zase.y(var35.c));
         var1.b();
         var1.b("a:chExt");
         var1.a("cx", zase.y(var35.b));
         var1.a("cy", zase.y(var35.d));
         var1.b();
      }

      var1.b();
   }

   private void a(zcfx var1, ShapePathPointCollection var2) throws Exception {
      if (var2.getCount() == 3) {
         var1.b("a:arcTo");
         ShapePathPoint var3 = var2.get(1);
         if (var3.a instanceof Integer) {
            var1.a("wR", zase.y((Integer)var3.a));
         } else {
            var1.a("wR", (String)var3.a);
         }

         if (var3.b instanceof Integer) {
            var1.a("hR", zase.y((Integer)var3.b));
         } else {
            var1.a("hR", (String)var3.b);
         }

         ShapePathPoint var4 = var2.get(2);
         if (var4.a instanceof Integer) {
            var1.a("stAng", zase.y((Integer)var4.a));
         } else {
            var1.a("stAng", (String)var4.a);
         }

         if (var4.b instanceof Integer) {
            var1.a("swAng", zase.y((Integer)var4.b));
         } else {
            var1.a("swAng", (String)var4.b);
         }

         var1.b();
      }

   }

   private void a(zcfx var1, ShapePathPoint var2) throws Exception {
      var1.b("a:pt");
      if (var2.a instanceof Integer) {
         var1.a("x", zase.y((Integer)var2.a));
      } else {
         var1.a("x", (String)var2.a);
      }

      if (var2.b instanceof Integer) {
         var1.a("y", zase.y((Integer)var2.b));
      } else {
         var1.a("y", (String)var2.b);
      }

      var1.b();
   }

   private void p(zcfx var1) throws Exception {
      ShapeGuide var6;
      ShapeGuideCollection var12;
      if (this.e.ah()) {
         CustomGeometry var2 = (CustomGeometry)this.e.getGeometry();
         var1.b("a:custGeom");
         ShapeGuideCollection var3 = null;
         if (var2 != null) {
            var3 = var2.f();
         }

         if (var3 != null) {
            var1.b("a:avLst");
            Iterator var4 = var3.iterator();

            while(var4.hasNext()) {
               ShapeGuide var5 = (ShapeGuide)var4.next();
               this.a(var1, var5);
            }

            var1.b();
         }

         var12 = var2.d();
         if (var12 != null && var12.getCount() > 0) {
            var1.b("a:gdLst");

            for(int var13 = 0; var13 < var12.getCount(); ++var13) {
               var6 = var12.get(var13);
               var1.b("a:gd");
               var1.a("name", var6.a());
               var1.a("fmla", var6.b());
               var1.b();
            }

            var1.b();
         }

         if (var2.b() != null) {
            var1.d(var2.b());
         }

         var1.b("a:pathLst");
         ShapePathCollection var14 = var2.getPaths();
         var14.b();

         for(int var16 = 0; var16 < var14.getCount(); ++var16) {
            ShapePath var7 = var14.get(var16);
            var1.b("a:path");
            if (var7.a) {
               var1.a("extrusionOk", "1");
            }

            if (var7.b != 5) {
               var1.a("fill", zsk.i(var7.b));
            }

            if (!var7.c) {
               var1.a("stroke", "0");
            }

            var1.a("h", zase.a(var7.d));
            var1.a("w", zase.a(var7.e));

            for(int var8 = 0; var8 < var7.getPathSegementList().getCount(); ++var8) {
               ShapeSegmentPath var9 = var7.getPathSegementList().get(var8);
               switch(var9.getType()) {
               case 0:
                  var1.b("a:lnTo");
                  this.a(var1, var9.getPoints().get(1));
                  var1.b();
                  break;
               case 1:
                  var1.b("a:cubicBezTo");
                  this.a(var1, var9.getPoints().get(1));
                  this.a(var1, var9.getPoints().get(2));
                  this.a(var1, var9.getPoints().get(3));
                  var1.b();
                  break;
               case 2:
                  var1.b("a:moveTo");
                  this.a(var1, var9.getPoints().get(0));
                  var1.b();
                  break;
               case 3:
                  var1.b("a:close");
                  var1.b();
               case 4:
               case 5:
               default:
                  break;
               case 6:
                  this.a(var1, var9.getPoints());
               }
            }

            var1.b();
         }

         var1.b();
         var1.b();
      } else {
         var1.b("a:prstGeom");
         int var10 = zase.aE(this.e.getAutoShapeType());
         if (var10 != 188) {
            var1.a("prst", zase.aD(var10));
         } else {
            var1.a("prst", "rect");
         }

         Geometry var11 = this.e.ag();
         var12 = null;
         if (var11 != null) {
            var12 = var11.f();
         }

         if (var11 != null && var12 != null && var12.getCount() > 0) {
            var1.b("a:avLst");
            Iterator var15 = var12.iterator();

            while(var15.hasNext()) {
               var6 = (ShapeGuide)var15.next();
               this.a(var1, var6);
            }

            var1.b();
         }

         var1.b();
      }

   }

   private void a(zcfx var1, ShapeGuide var2) throws Exception {
      if (var2.a() != null && var2.b() != null) {
         var1.b("a:gd");
         var1.a("name", var2.a());
         var1.a("fmla", var2.b());
         var1.b();
      }
   }

   private void q(zcfx var1) throws Exception {
      if (this.e.getFill().getType() == 0 && this.e.getFill().c) {
         this.e.getFill().setType(2);
         this.e.getFill().getSolidFill().setColor(Color.getWhite());
      }

      ztj var2 = new ztj(this.a);
      var2.a(var1, this.e.getFill());
   }

   private void r(zcfx var1) throws Exception {
      if (this.e.isGroup()) {
         var1.b(this.g + ":grpSpPr");
      } else {
         var1.b(this.g + ":spPr");
      }

      if (this.e.y != null) {
         var1.a("bwMode", this.e.y);
      }

      this.o(var1);
      if (!this.e.isGroup()) {
         this.p(var1);
      }

      this.q(var1);
      if (!this.e.isGroup()) {
         this.y(var1);
      }

      this.t(var1);
      var1.b();
   }

   private void s(zcfx var1) throws Exception {
      if (this.e.isGroup()) {
         var1.b(this.g + ":grpSpPr");
      } else {
         var1.b(this.g + ":spPr");
      }

      this.o(var1);
      var1.c("a:prstGeom", (String)null);
      var1.a("prst", "rect");
      var1.b();
      var1.b("a:noFill", (String)null);
      var1.b();
   }

   private void t(zcfx var1) throws Exception {
      boolean var2 = this.a(67108864L, var1);
      if (!var2) {
         this.a(134217728L, var1);
      }

      this.a(33554432L, var1);
      this.a(268435456L, var1);
      this.a(536870912L, var1);
   }

   private boolean a(long var1, zcfx var3) throws Exception {
      String var4 = this.a(var1);
      if (var4 != null) {
         var3.d(var4);
         return true;
      } else {
         return false;
      }
   }

   private void u(zcfx var1) throws Exception {
      String var2 = this.a(1073741824L);
      if (this.b(1073741824L)) {
         var2 = zase.y(zase.a(this.e.getLineFormat().getWeight()));
      }

      if (var2 != null) {
         var1.a("w", var2);
      }

      String var3 = this.a(2147483648L);
      if (var3 != null) {
         var1.a("cap", var3);
      }

      String var4 = this.a(4294967296L);
      if (this.b(4294967296L)) {
         var4 = zase.n(this.e.getLineFormat().getStyle());
      }

      if (var4 != null) {
         var1.a("cmpd", var4);
      }

      String var5 = this.a(8589934592L);
      if (var5 != null) {
         var1.a("algn", var5);
      }

   }

   private void v(zcfx var1) throws Exception {
      boolean var2;
      if (!this.b(34359738368L)) {
         var2 = this.a(68719476736L, var1);
         if (!var2) {
            var2 = this.a(137438953472L, var1);
            if (!var2) {
               this.a(34359738368L, var1);
            }
         }
      } else if (!this.e.getLineFormat().a(448) && !this.e.getLineFormat().a(449)) {
         if (this.e.getLineFormat().isVisible() && (zase.aH(this.e.getAutoShapeType()) || this.e.y() == null || this.e.y().a == null)) {
            var1.b("a:solidFill");
            var1.b("a:srgbClr");
            var1.a("val", "000000");
            var1.b();
            var1.b();
         }
      } else {
         var2 = this.e.getLineFormat().b();
         Color var3 = this.e.getLineFormat().getForeColor();
         var2 = com.aspose.cells.a.c.zh.a(var3);
         double var4 = this.e.getLineFormat().c();
         if (var4 != 1.0D || !var2) {
            var1.b("a:solidFill");
            if (!var2) {
               var1.b("a:srgbClr");
               String var6 = com.aspose.cells.a.c.zp.e(var3.toArgb()).substring(2);
               var1.a("val", var6);
            }

            if (var4 != 1.0D) {
               var1.b("a:alpha");
               int var7 = (int)(100000.0D * this.e.getLineFormat().c());
               var1.a("val", zase.y(var7));
               var1.b();
            }

            var1.b();
            var1.b();
         }
      }

   }

   private void w(zcfx var1) throws Exception {
      if (!this.b(549755813888L)) {
         boolean var2 = this.a(274877906944L, var1);
         if (!var2) {
            this.a(549755813888L, var1);
         }
      } else if (this.e.getLineFormat().getDashStyle() != 6) {
         String var3 = zasd.a(this.e.getLineFormat().getDashStyle());
         var1.b("a:prstDash");
         var1.a("val", var3);
         var1.b();
      }

   }

   private void x(zcfx var1) throws Exception {
      this.a(4398046511104L, var1);
      this.a(1099511627776L, var1);
      this.a(2199023255552L, var1);
      this.a(35184372088832L, var1);
   }

   private void y(zcfx var1) throws Exception {
      if (this.e.getLineFormat().isVisible()) {
         var1.b("a:ln");
         this.u(var1);
         this.v(var1);
         this.w(var1);
         this.x(var1);
         this.a(var1, true);
         this.a(var1, false);
         var1.b();
      } else {
         var1.b("a:ln");
         this.u(var1);
         var1.b("a:noFill", (String)null);
         var1.b();
      }

   }

   private void a(zcfx var1, boolean var2) throws Exception {
      MsoLineFormat var3 = this.e.getLineFormat();
      Integer var4 = null;
      Integer var5 = null;
      Integer var6 = null;
      String var7 = null;
      zbjo var8;
      if (var2) {
         var4 = var3.d();
         var8 = var3.a().c(466);
         if (var8 != null) {
            var5 = var3.e();
         }

         var8 = var3.a().c(467);
         if (var8 != null) {
            var6 = var3.f();
         }

         var7 = "headEnd";
      } else {
         var4 = var3.g();
         var8 = var3.a().c(466);
         if (var8 != null) {
            var5 = var3.h();
         }

         var8 = var3.a().c(467);
         if (var8 != null) {
            var6 = var3.i();
         }

         var7 = "tailEnd";
      }

      if ((Integer)var4 != 0) {
         var1.c("a:" + var7, (String)null);
         var1.a("type", zasd.c((Integer)var4));
         if (var5 != null) {
            var1.a("w", zasd.e((Integer)var5));
         }

         if (var6 != null) {
            var1.a("len", zasd.d((Integer)var6));
         }

         var1.b();
      }
   }

   private void z(zcfx var1) throws Exception {
      var1.b(this.g + ":blipFill");
      var1.b("a:blip");
      if (this.a.e != null) {
         var1.a("r:embed", this.a.e);
      }

      if (this.a.f != null) {
         var1.a("r:link", this.a.f);
      }

      if (this.a.a.getFormatPicture().a != null) {
         this.A(var1);
      }

      if (this.a.a.getFormatPicture().b != null) {
         for(int var2 = 0; var2 < this.a.a.getFormatPicture().b.size(); ++var2) {
            var1.d((String)this.a.a.getFormatPicture().b.get(var2));
         }
      }

      var1.b();
      this.B(var1);
      if (!this.e.aj()) {
         var1.b("a:stretch");
         var1.b("a:fillRect");
         var1.b();
         var1.b();
      }

      var1.b();
   }

   private void A(zcfx var1) throws Exception {
      var1.b("a:clrChange");
      var1.b("a:clrFrom");
      ztj.a(var1, this.a.a.getFormatPicture().a.a, -1, this.a.j.a);
      var1.b();
      var1.b("a:clrTo");
      ztj.a(var1, this.a.a.getFormatPicture().a.b, -1, this.a.j.a);
      var1.b();
      var1.b();
   }

   private void B(zcfx var1) throws Exception {
      MsoFormatPicture var2 = this.e.getFormatPicture();
      double var3 = var2.getTopCrop();
      double var5 = var2.getBottomCrop();
      double var7 = var2.getLeftCrop();
      double var9 = var2.getRightCrop();
      if (var3 != 0.0D || var5 != 0.0D || var7 != 0.0D || var9 != 0.0D) {
         var1.b("a:srcRect");
         if (var7 > 0.0D) {
            var1.a("l", zase.y((int)(var7 * 100000.0D)));
         }

         if (var3 > 0.0D) {
            var1.a("t", zase.y((int)(var3 * 100000.0D)));
         }

         if (var9 > 0.0D) {
            var1.a("r", zase.y((int)(var9 * 100000.0D)));
         }

         if (var5 > 0.0D) {
            var1.a("b", zase.y((int)(var5 * 100000.0D)));
         }

         var1.b();
      }
   }

   private void C(zcfx var1) throws Exception {
      var1.b(this.g + ":cNvPr");
      if (this.a.c != null) {
         var1.a("id", this.a.c.g);
      } else {
         var1.a("id", zase.y(this.e.K()));
      }

      String var2 = this.e.getName();
      if (var2 != null && !"".equals(var2)) {
         var1.a("name", zase.a(var2));
      }

      String var3 = this.e.getAlternativeText();
      if (var3 != null && !"".equals(var3)) {
         var1.a("descr", var3);
      }

      String var4 = this.e.getTitle();
      if (var4 != null && !"".equals(var4)) {
         var1.a("title", var4);
      }

      if (this.e.isHidden()) {
         var1.a("hidden", "1");
      } else if (this.a.c != null && (this.e.getMsoDrawingType() != 8 || this.e.x != null)) {
         var1.a("hidden", "1");
      }

      if (this.a.c != null) {
         var1.b("a:extLst");
         var1.b("a:ext");
         var1.a("uri", "{63B3BB69-23CF-44E3-9099-C40C66FF867C}");
         var1.b("a14:compatExt");
         var1.a("spid", this.a.c.f == null ? this.a.c.e : this.a.c.f);
         var1.b();
         var1.b();
         var1.b();
      }

      if (this.a.g != null) {
         Hyperlink var5 = this.e.getHyperlink();
         var1.b("a:hlinkClick");
         var1.a("r:id", this.a.g);
         if (var5.getScreenTip() != null && !"".equals(var5.getScreenTip())) {
            var1.a("tooltip", var5.getScreenTip());
         }

         var1.b();
      }

      var1.b();
   }

   private void D(zcfx var1) throws Exception {
      if (this.a.a.getMsoDrawingType() == 5) {
         var1.b(this.g + ":graphicFrame");
         this.E(var1);
         var1.b(this.g + ":nvGraphicFramePr");
         this.C(var1);
         var1.b(this.g + ":cNvGraphicFramePr", (String)null);
         var1.b();
         this.o(var1);
         var1.b("a:graphic");
         var1.b("a:graphicData");
         var1.a("uri", "http://schemas.openxmlformats.org/drawingml/2006/chart");
         var1.b("c:chart");
         var1.a("xmlns:c", "http://schemas.openxmlformats.org/drawingml/2006/chart");
         var1.a("r:id", this.a.e);
         var1.b();
         var1.b();
         var1.b();
         var1.b();
      }
   }

   private String a(long var1) {
      return this.h != null && this.h.a != null ? this.h.c(var1) : null;
   }

   private boolean b(long var1) {
      return this.h != null && this.h.a != null ? this.h.a(var1) : true;
   }

   private void E(zcfx var1) throws Exception {
      if (this.e.v() != null) {
         var1.a("macro", this.e.v());
      }

      if (this.e.ak()) {
         var1.a("fPublished", "1");
      }

      if (this.e.w != null && !this.e.aa().m()) {
         var1.a("fLocksText", "0");
      }

      String var2 = this.e.getLinkedCell();
      if (var2 != null && this.a.c == null) {
         var1.a("textlink", var2);
      }

   }

   private void F(zcfx var1) throws Exception {
      switch(this.a.d) {
      case 0:
      default:
         a(var1, this.e, false);
         break;
      case 1:
         this.I(var1);
         break;
      case 2:
         this.G(var1);
         break;
      case 3:
         this.J(var1);
         break;
      case 4:
         this.H(var1);
      }

   }

   private void G(zcfx var1) throws Exception {
      byte var2 = 0;
      byte var3 = 0;
      byte var4 = 0;
      byte var5 = 0;
      int[] var6 = new int[]{var2};
      int[] var7 = new int[]{var3};
      int[] var8 = new int[]{var4};
      int[] var9 = new int[]{var5};
      this.e.a(var6, var7, var8, var9);
      int var18 = var6[0];
      int var19 = var7[0];
      int var20 = var8[0];
      int var21 = var9[0];
      double var10 = Math.min(1.0D, (double)var18 / 4000.0D);
      double var12 = Math.min(1.0D, (double)var19 / 4000.0D);
      double var14 = Math.min(1.0D, (double)var20 / 4000.0D);
      double var16 = Math.min(1.0D, (double)var21 / 4000.0D);
      var1.b("cdr:from");
      var1.b("cdr:x");
      var1.a(zase.b(var10));
      var1.b();
      var1.b("cdr:y");
      var1.a(zase.b(var12));
      var1.b();
      var1.b();
      var1.b("cdr:to");
      var1.b("cdr:x");
      var1.a(zase.b(var14));
      var1.b();
      var1.b("cdr:y");
      var1.a(zase.b(var16));
      var1.b();
      var1.b();
   }

   private void H(zcfx var1) throws Exception {
      byte var2 = 0;
      byte var3 = 0;
      byte var4 = 0;
      byte var5 = 0;
      int[] var6 = new int[]{var2};
      int[] var7 = new int[]{var3};
      int[] var8 = new int[]{var4};
      int[] var9 = new int[]{var5};
      this.e.a(var6, var7, var8, var9);
      int var16 = var6[0];
      int var17 = var7[0];
      int var18 = var8[0];
      int var19 = var9[0];
      double var10 = Math.min(1.0D, (double)var16 / 4000.0D);
      double var12 = Math.min(1.0D, (double)var17 / 4000.0D);
      int var14 = this.e.getWidth();
      int var15 = this.e.getHeight();
      var14 = zase.a((double)var14, this.d);
      var15 = zase.a((double)var15, this.d);
      var1.b("cdr:from");
      var1.b("cdr:x");
      var1.a(zase.b(var10));
      var1.b();
      var1.b("cdr:y");
      var1.a(zase.b(var12));
      var1.b();
      var1.b();
      var1.b("cdr:ext");
      var1.a("cx", zase.y(var14));
      var1.a("cy", zase.y(var15));
      var1.b();
   }

   private void I(zcfx var1) throws Exception {
      int var2 = this.e.getWidth();
      int var3 = this.e.getHeight();
      var2 = zase.a((double)var2, this.d);
      var3 = zase.a((double)var3, this.d);
      var1.b("xdr:pos");
      var1.a("x", "0");
      var1.a("y", "0");
      var1.b();
      var1.b("xdr:ext");
      var1.a("cx", zase.y(var2));
      var1.a("cy", zase.y(var3));
      var1.b();
   }

   private void J(zcfx var1) throws Exception {
      int var2 = this.e.getUpperLeftColumn();
      int var3 = this.e.getLeft();
      int var4 = this.e.getUpperLeftRow();
      int var5 = this.e.getTop();
      var1.b("xdr:from");
      var1.b("xdr:col");
      var1.a(zase.y(var2));
      var1.b();
      var1.b("xdr:colOff");
      var1.a(zase.y(zase.a((double)var3, this.d)));
      var1.b();
      var1.b("xdr:row");
      var1.a(zase.y(var4));
      var1.b();
      var1.b("xdr:rowOff");
      var1.a(zase.y(zase.a((double)var5, this.d)));
      var1.b();
      var1.b();
      int var6 = this.e.getWidth();
      int var7 = this.e.getHeight();
      var6 = zase.a((double)var6, this.d);
      var7 = zase.a((double)var7, this.d);
      var1.b("xdr:ext");
      var1.a("cx", zase.y(var6));
      var1.a("cy", zase.y(var7));
      var1.b();
   }

   static void a(zcfx var0, Shape var1, boolean var2) throws Exception {
      int[] var3 = var1.I();
      int var4 = var3[0];
      int var5 = var3[1];
      int var6 = var3[2];
      int var7 = var3[3];
      int var8 = var3[4];
      int var9 = var3[5];
      int var10 = var3[6];
      int var11 = var3[7];
      var0.b(var2 ? "from" : "xdr:from");
      var0.b("xdr:col");
      var0.a(zase.y(var4));
      var0.b();
      var0.b("xdr:colOff");
      var0.a(zase.y(var5));
      var0.b();
      var0.b("xdr:row");
      var0.a(zase.y(var6));
      var0.b();
      var0.b("xdr:rowOff");
      var0.a(zase.y(var7));
      var0.b();
      var0.b();
      var0.b(var2 ? "to" : "xdr:to");
      var0.b("xdr:col");
      var0.a(zase.y(var8));
      var0.b();
      var0.b("xdr:colOff");
      var0.a(zase.y(var9));
      var0.b();
      var0.b("xdr:row");
      var0.a(zase.y(var10));
      var0.b();
      var0.b("xdr:rowOff");
      var0.a(zase.y(var11));
      var0.b();
      var0.b();
   }
}
